1. Field of the Invention
The present invention relates to the field of computer systems. More specifically, the present invention relates to accessing input/output devices of computer systems by executing programs.
2. Background Information
Input/Output (I/O) devices are typically accessed by executing programs through device drivers provided by the operating systems of the computer systems. The device drivers serve to shield the device characteristics from the executing programs. To facilitate implementation of device drivers, particularly device drivers for character devices, some common functions are implemented as intermediate non-device specific I/O modules. To access an I/O device, an executing program would logically connect itself to the I/O device through the I/O device's device driver, with or without going through one or more non-device specific I/O modules depending on the implementation.
Unlike execution time or memory resource where most operating systems include some kind of timesharing or prioritization schemes, connections to character devices are typically implemented in exclusive manners. In other words, once an executing program connects itself to a character device, the character device is not available to other executing programs until the connecting executing program relinquishes the character device. In many applications, experience has shown that exclusive connections to certain character device resources adversely impact system performance, e.g. connections to various types of audio channels in a telephonic application. It is more desirable if the connections to these character device resources are preemptable.
A prior art solution is to implement a policy server and a switching controller in user space. Accessing programs are required to be connected to the device drivers through the switching controller, and switching preemption is regulated by the policy server. However, because the policy server and the switching controller are in user space, while the device drivers and the intermediate non-device specific I/O modules are in system space, the prior art solution suffer from the disadvantage of having to have multiple copies of data maintained in both user and system space. As a result, significant amount of system resource are consumed in copying and transferring data between the user and system space. This negative performance impact increases exponentially with increased volume of data traffic.
Thus, it is desirable to be able to implement preemptable multiplexing of connections to I/O devices with improved performance characteristics. It is also desirable that the new enhanced solution is backward compatible and can operate in a manner that is transparent to existing applications who have no knowledge of the new enhanced solution. As will be disclosed, the present invention provides such a method and apparatus for multiplexing connections to I/O devices that achieves these and other desired results.